package com.stu.vertx.hello.otherTest;


import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;

import java.io.IOException;


public class TestBase64 {
    public static void main(String args[]) {

        // 1.测试：文件 转 Base64
        // 2.测试：Base64 转 文件
//        try {
//            File filePath = new File("D:\\aa.jpg");
//            byte[] tempBase64Str = CallableTest.getBytesByFile(filePath);
//            System.out.println(Base64.encode(tempBase64Str));
//        } catch (IOException e) {
//            e.getMessage();
//        }
        HttpClient client = new HttpClient();
        // Create a method instance.
        GetMethod method = new GetMethod("https://webtrade2.citics.com.hk/mobile/services/v0/getQuote?instrumentID=SZMK:000002&token=72E1B292023196C1C4967BB71C8E077D&language=en_US");
        try {
            int statusCode = client.executeMethod(method);
            System.out.println(statusCode);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
